<template>
  <div>
    <div v-if="showTitle" class="title-area">
      <span>舟山市</span>
      <span>【{{ title.organizationName }}】</span>
      <span>-{{ title.year }}台账统计</span>
    </div>
    <el-row :gutter="20">
      <el-col :span="routerType != 3 && isShow ? 20 : 24">
        <el-table
          ref="excelTable"
          border
          height="650px"
          v-loading="loading"
          :data="dataList"
          row-key="deptId"
          :default-expand-all="isExpandAll"
          :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
        >
          <el-table-column
            prop="organizationName"
            label="部门名称"
            min-width="260"
            show-overflow-tooltip
          >
            <!-- <template slot-scope="scope">
                  <div v-if="scope.row.organizationName">
                    {{ scope.row.organizationName }}
                  </div>
                  <div v-else>{{ scope.row.deptName }}</div>
                </template> -->
          </el-table-column>

          <el-table-column label="" align="center">
            <el-table-column
              label="公共机构数量"
              show-overflow-tooltip
              align="center"
            >
              <el-table-column
                prop="publicOrganizationNum"
                label="个"
                show-overflow-tooltip
                align="center"
                width="120"
              ></el-table-column>
            </el-table-column>
            <el-table-column
              label="用地面积"
              show-overflow-tooltip
              align="center"
            >
              <el-table-column
                prop="landArea"
                label="平方米"
                show-overflow-tooltip
                align="center"
                width="120"
              >
                <!-- <template slot-scope="scope">
                      <div>{{ scope.row.landArea | numDealfilters }}</div>
                    </template> -->
              </el-table-column>
            </el-table-column>
            <el-table-column
              label="建筑面积"
              show-overflow-tooltip
              align="center"
            >
              <el-table-column
                prop="coveredArea"
                label="平方米"
                show-overflow-tooltip
                align="center"
                width="120"
              >
                <!-- <template slot-scope="scope">
                      <div>{{ scope.row.coveredArea | numDealfilters }}</div>
                    </template> -->
              </el-table-column>
            </el-table-column>
            <el-table-column
              label="用能人数"
              show-overflow-tooltip
              align="center"
            >
              <el-table-column
                prop="energyPeopleNum"
                label="人"
                show-overflow-tooltip
                align="center"
                width="120"
              ></el-table-column>
            </el-table-column>
            <el-table-column
              label="编制人数"
              show-overflow-tooltip
              align="center"
            >
              <el-table-column
                prop="organizationPeopleNum"
                label="人"
                show-overflow-tooltip
                align="center"
                width="120"
              ></el-table-column>
            </el-table-column>
            <el-table-column
              label="车辆总数"
              show-overflow-tooltip
              align="center"
            >
              <el-table-column
                prop="carNum"
                label="辆"
                show-overflow-tooltip
                align="center"
                width="120"
              ></el-table-column>
            </el-table-column>
          </el-table-column>

          <el-table-column label="其中" align="center">
            <el-table-column
              label="汽油车数量"
              show-overflow-tooltip
              align="center"
            >
              <el-table-column
                prop="carGasolineNum"
                label="辆"
                show-overflow-tooltip
                align="center"
                width="120"
              ></el-table-column>
            </el-table-column>
            <el-table-column
              label="柴油车数量"
              show-overflow-tooltip
              align="center"
            >
              <el-table-column
                prop="carDieselNum"
                label="辆"
                show-overflow-tooltip
                align="center"
                width="120"
              ></el-table-column>
            </el-table-column>
            <el-table-column
              label="新能源汽车数量"
              show-overflow-tooltip
              align="center"
            >
              <el-table-column
                prop="carNewEnergyNum"
                label="辆"
                show-overflow-tooltip
                align="center"
                width="140"
              ></el-table-column>
            </el-table-column>
          </el-table-column>

          <el-table-column label="碳排放量" align="center">
            <el-table-column
              label="排放量"
              show-overflow-tooltip
              align="center"
            >
              <el-table-column
                prop=""
                label="吨"
                show-overflow-tooltip
                align="center"
                width="120"
                disabled
              >
                <template>
                  <div>-</div>
                </template>
              </el-table-column>
            </el-table-column>
          </el-table-column>

          <el-table-column label="电" align="center">
            <el-table-column
              label="消费量"
              show-overflow-tooltip
              align="center"
            >
              <el-table-column
                prop="energyElectricity"
                label="千瓦时"
                show-overflow-tooltip
                align="center"
                width="120"
              >
                <!-- <template slot-scope="scope">
                      <div>{{ scope.row.energyElectricity | numDealfilters }}</div>
                    </template> -->
              </el-table-column>
            </el-table-column>
            <el-table-column label="费用" show-overflow-tooltip align="center">
              <el-table-column
                prop="feeElectricity"
                label="元"
                show-overflow-tooltip
                align="center"
                width="120"
              >
                <!-- <template slot-scope="scope">
                      <div>{{ scope.row.feeElectricity | numDealfilters }}</div>
                    </template> -->
              </el-table-column>
            </el-table-column>
          </el-table-column>

          <el-table-column label="水" align="center">
            <el-table-column
              label="消费量"
              show-overflow-tooltip
              align="center"
            >
              <el-table-column
                prop="energyWater"
                label="吨"
                show-overflow-tooltip
                align="center"
                width="120"
              >
                <!-- <template slot-scope="scope">
                      <div>{{ scope.row.energyWater | numDealfilters }}</div>
                    </template> -->
              </el-table-column>
            </el-table-column>
            <el-table-column label="费用" show-overflow-tooltip align="center">
              <el-table-column
                prop="feeWater"
                label="元"
                show-overflow-tooltip
                align="center"
                width="120"
              >
                <!-- <template slot-scope="scope">
                      <div>{{ scope.row.feeWater | numDealfilters }}</div>
                    </template> -->
              </el-table-column>
            </el-table-column>
          </el-table-column>

          <el-table-column label="煤炭" align="center">
            <el-table-column
              label="消费量"
              show-overflow-tooltip
              align="center"
            >
              <el-table-column
                prop="energyCoal"
                label="吨"
                show-overflow-tooltip
                align="center"
                width="120"
              >
                <!-- <template slot-scope="scope">
                      <div>{{ scope.row.energyCoal | numDealfilters }}</div>
                    </template> -->
              </el-table-column>
            </el-table-column>
            <el-table-column label="费用" show-overflow-tooltip align="center">
              <el-table-column
                prop="feeCoal"
                label="元"
                show-overflow-tooltip
                align="center"
                width="120"
              >
                <!-- <template slot-scope="scope">
                      <div>{{ scope.row.feeCoal | numDealfilters }}</div>
                    </template> -->
              </el-table-column>
            </el-table-column>
          </el-table-column>

          <el-table-column label="天然气" align="center">
            <el-table-column
              label="消费量"
              show-overflow-tooltip
              align="center"
            >
              <el-table-column
                prop="energyNaturalGas"
                label="立方米"
                show-overflow-tooltip
                align="center"
                width="120"
              ></el-table-column>
            </el-table-column>
            <el-table-column label="费用" show-overflow-tooltip align="center">
              <el-table-column
                prop="feeNaturalGas"
                label="元"
                show-overflow-tooltip
                align="center"
                width="120"
              >
                <!-- <template slot-scope="scope">
                      <div>{{ scope.row.feeNaturalGas | numDealfilters }}</div>
                    </template> -->
              </el-table-column>
            </el-table-column>
          </el-table-column>

          <el-table-column label="再生能源" align="center">
            <el-table-column
              label="消费量"
              show-overflow-tooltip
              align="center"
            >
              <el-table-column
                prop="salesVolumeOfRenewableEnergy"
                label="千卡"
                show-overflow-tooltip
                align="center"
                width="120"
              >
                <!-- <template slot-scope="scope">
                      <div>
                        {{
                          scope.row.salesVolumeOfRenewableEnergy | numDealfilters
                        }}
                      </div>
                    </template> -->
              </el-table-column>
            </el-table-column>
            <el-table-column label="费用" show-overflow-tooltip align="center">
              <el-table-column
                prop="renewableEnergyCosts"
                label="元"
                show-overflow-tooltip
                align="center"
                width="120"
              >
                <!-- <template slot-scope="scope">
                      <div>
                        {{ scope.row.renewableEnergyCosts | numDealfilters }}
                      </div>
                    </template> -->
              </el-table-column>
            </el-table-column>
          </el-table-column>

          <el-table-column label="绿电消费" align="center">
            <el-table-column
              label="消费量"
              show-overflow-tooltip
              align="center"
            >
              <el-table-column
                prop="greenElectricitySalesFeeVolume"
                label="千瓦时"
                show-overflow-tooltip
                align="center"
                width="120"
              >
                <!-- <template slot-scope="scope">
                      <div>
                        {{
                          scope.row.greenElectricitySalesFeeVolume | numDealfilters
                        }}
                      </div>
                    </template> -->
              </el-table-column>
            </el-table-column>
            <el-table-column label="费用" show-overflow-tooltip align="center">
              <el-table-column
                prop="greenElectricityCost"
                label="元"
                show-overflow-tooltip
                align="center"
                width="120"
              >
                <!-- <template slot-scope="scope">
                      <div>
                        {{ scope.row.greenElectricityCost | numDealfilters }}
                      </div>
                    </template> -->
              </el-table-column>
            </el-table-column>
          </el-table-column>

          <el-table-column label="碳汇消费" align="center">
            <el-table-column
              label="消费量"
              show-overflow-tooltip
              align="center"
            >
              <el-table-column
                prop="carbonRemittanceSalesFeeVolume"
                label="吨"
                show-overflow-tooltip
                align="center"
                width="120"
              >
                <!-- <template slot-scope="scope">
                      <div>
                        {{
                          scope.row.carbonRemittanceSalesFeeVolume | numDealfilters
                        }}
                      </div>
                    </template> -->
              </el-table-column>
            </el-table-column>
            <el-table-column label="费用" show-overflow-tooltip align="center">
              <el-table-column
                prop="carbonSinkFees"
                label="元"
                show-overflow-tooltip
                align="center"
                width="120"
              >
                <!-- <template slot-scope="scope">
                      <div>
                        {{ scope.row.carbonSinkFees | numDealfilters }}
                      </div>
                    </template> -->
              </el-table-column>
            </el-table-column>
          </el-table-column>

          <el-table-column label="汽油" align="center">
            <el-table-column
              label="消费总量"
              show-overflow-tooltip
              align="center"
            >
              <el-table-column
                prop="energyGasoline"
                label="升"
                show-overflow-tooltip
                align="center"
                width="120"
              >
                <!-- <template slot-scope="scope">
                      <div>
                        {{ scope.row.energyGasoline | numDealfilters }}
                      </div>
                    </template> -->
              </el-table-column>
            </el-table-column>
            <el-table-column label="费用" show-overflow-tooltip align="center">
              <el-table-column
                prop="feeGasoline"
                label="元"
                show-overflow-tooltip
                align="center"
                width="120"
              >
                <!-- <template slot-scope="scope">
                      <div>
                        {{ scope.row.feeGasoline | numDealfilters }}
                      </div>
                    </template> -->
              </el-table-column>
            </el-table-column>
            <el-table-column
              label="车辆用油量"
              show-overflow-tooltip
              align="center"
            >
              <el-table-column
                prop="energyCarGasoline"
                label="升"
                show-overflow-tooltip
                align="center"
                width="120"
              >
                <!-- <template slot-scope="scope">
                      <div>
                        {{ scope.row.energyCarGasoline | numDealfilters }}
                      </div>
                    </template> -->
              </el-table-column>
            </el-table-column>
            <el-table-column label="费用" show-overflow-tooltip align="center">
              <el-table-column
                prop="feeCarGasoline"
                label="元"
                show-overflow-tooltip
                align="center"
                width="120"
              >
                <!-- <template slot-scope="scope">
                      <div>
                        {{ scope.row.feeCarGasoline | numDealfilters }}
                      </div>
                    </template> -->
              </el-table-column>
            </el-table-column>
            <el-table-column
              label="其他用油量"
              show-overflow-tooltip
              align="center"
            >
              <el-table-column
                prop="energyOtherGasoline"
                label="升"
                show-overflow-tooltip
                align="center"
                width="120"
              >
                <!-- <template slot-scope="scope">
                      <div>
                        {{ scope.row.energyOtherGasoline | numDealfilters }}
                      </div>
                    </template> -->
              </el-table-column>
            </el-table-column>
            <el-table-column label="费用" show-overflow-tooltip align="center">
              <el-table-column
                prop="feeOtherGasoline"
                label="元"
                show-overflow-tooltip
                align="center"
                width="120"
              >
                <!-- <template slot-scope="scope">
                      <div>
                        {{ scope.row.feeOtherGasoline | numDealfilters }}
                      </div>
                    </template> -->
              </el-table-column>
            </el-table-column>
          </el-table-column>

          <el-table-column label="柴油" align="center">
            <el-table-column
              label="消费总量"
              show-overflow-tooltip
              align="center"
            >
              <el-table-column
                prop="energyDiesel"
                label="升"
                show-overflow-tooltip
                align="center"
                width="120"
              >
                <!-- <template slot-scope="scope">
                      <div>
                        {{ scope.row.energyDiesel | numDealfilters }}
                      </div>
                    </template> -->
              </el-table-column>
            </el-table-column>
            <el-table-column label="费用" show-overflow-tooltip align="center">
              <el-table-column
                prop="feeDiesel"
                label="元"
                show-overflow-tooltip
                align="center"
                width="120"
              >
                <!-- <template slot-scope="scope">
                      <div>
                        {{ scope.row.feeDiesel | numDealfilters }}
                      </div>
                    </template> -->
              </el-table-column>
            </el-table-column>
            <el-table-column
              label="车辆用油量"
              show-overflow-tooltip
              align="center"
            >
              <el-table-column
                prop="energyCarDiesel"
                label="升"
                show-overflow-tooltip
                align="center"
                width="120"
              >
                <!-- <template slot-scope="scope">
                      <div>
                        {{ scope.row.energyCarDiesel | numDealfilters }}
                      </div>
                    </template> -->
              </el-table-column>
            </el-table-column>
            <el-table-column label="费用" show-overflow-tooltip align="center">
              <el-table-column
                prop="feeCarDiesel"
                label="元"
                show-overflow-tooltip
                align="center"
                width="120"
              >
                <!-- <template slot-scope="scope">
                      <div>
                        {{ scope.row.feeCarDiesel | numDealfilters }}
                      </div>
                    </template> -->
              </el-table-column>
            </el-table-column>
            <el-table-column
              label="其他用油量"
              show-overflow-tooltip
              align="center"
            >
              <el-table-column
                prop="energyOtherDiesel"
                label="升"
                show-overflow-tooltip
                align="center"
                width="120"
              >
                <!-- <template slot-scope="scope">
                      <div>
                        {{ scope.row.energyOtherDiesel | numDealfilters }}
                      </div>
                    </template> -->
              </el-table-column>
            </el-table-column>
            <el-table-column label="费用" show-overflow-tooltip align="center">
              <el-table-column
                prop="feeOtherDiesel"
                label="元"
                show-overflow-tooltip
                align="center"
                width="120"
              >
                <!-- <template slot-scope="scope">
                      <div>
                        {{ scope.row.feeOtherDiesel | numDealfilters }}
                      </div>
                    </template> -->
              </el-table-column>
            </el-table-column>
          </el-table-column>

          <el-table-column label="液化石油气" align="center">
            <el-table-column
              label="消费量"
              show-overflow-tooltip
              align="center"
            >
              <el-table-column
                prop="energyLpg"
                label="千克"
                show-overflow-tooltip
                align="center"
                width="120"
              ></el-table-column>
            </el-table-column>
            <el-table-column label="费用" show-overflow-tooltip align="center">
              <el-table-column
                prop="feeLpg"
                label="元"
                show-overflow-tooltip
                align="center"
                width="120"
              >
                <!-- <template slot-scope="scope">
                      <div>
                        {{ scope.row.feeLpg | numDealfilters }}
                      </div>
                    </template> -->
              </el-table-column>
            </el-table-column>
          </el-table-column>

          <el-table-column label="热力" align="center">
            <el-table-column
              label="消费量"
              show-overflow-tooltip
              align="center"
            >
              <el-table-column
                prop="energyHeat"
                label="吉焦"
                show-overflow-tooltip
                align="center"
                width="120"
              >
                <!-- <template slot-scope="scope">
                      <div>
                        {{ scope.row.energyHeat | numDealfilters }}
                      </div>
                    </template> -->
              </el-table-column>
            </el-table-column>
            <el-table-column label="费用" show-overflow-tooltip align="center">
              <el-table-column
                prop="feeHeat"
                label="元"
                show-overflow-tooltip
                align="center"
                width="120"
              >
                <!-- <template slot-scope="scope">
                      <div>
                        {{ scope.row.feeHeat | numDealfilters }}
                      </div>
                    </template> -->
              </el-table-column>
            </el-table-column>
          </el-table-column>

          <el-table-column label="其他能源" align="center">
            <el-table-column
              label="消费量"
              show-overflow-tooltip
              align="center"
            >
              <el-table-column
                prop="energyOtherPower"
                label="吨标准煤"
                show-overflow-tooltip
                align="center"
                width="120"
              ></el-table-column>
            </el-table-column>
            <el-table-column label="费用" show-overflow-tooltip align="center">
              <el-table-column
                prop="feeOtherPower"
                label="元"
                show-overflow-tooltip
                align="center"
                width="120"
              >
                <!-- <template slot-scope="scope">
                      <div>
                        {{ scope.row.feeOtherPower | numDealfilters }}
                      </div>
                    </template> -->
              </el-table-column>
            </el-table-column>
          </el-table-column>

          <el-table-column label="充电桩" align="center">
            <el-table-column label="数量" show-overflow-tooltip align="center">
              <el-table-column
                prop="chargingPileNum"
                label="个"
                show-overflow-tooltip
                align="center"
                width="120"
              ></el-table-column>
            </el-table-column>
          </el-table-column>

          <el-table-column label="可再生能源" align="center">
            <el-table-column
              label="太阳能集热器面积(已建成)"
              show-overflow-tooltip
              align="center"
            >
              <el-table-column
                prop="solarThermalCollectorArea"
                label="平方米"
                show-overflow-tooltip
                align="center"
                width="220"
              >
                <!-- <template slot-scope="scope">
                      <div>
                        {{ scope.row.solarThermalCollectorArea | numDealfilters }}
                      </div>
                    </template> -->
              </el-table-column>
            </el-table-column>
            <el-table-column
              label="太阳能光伏可安装面积"
              show-overflow-tooltip
              align="center"
            >
              <el-table-column
                prop="solarPanelInstallArea"
                label="平方米"
                show-overflow-tooltip
                align="center"
                width="220"
              >
                <!-- <template slot-scope="scope">
                      <div>
                        {{ scope.row.solarPanelInstallArea | numDealfilters }}
                      </div>
                    </template> -->
              </el-table-column>
            </el-table-column>
            <el-table-column
              label="太阳能光电系统装机容量(已建成)"
              show-overflow-tooltip
              align="center"
            >
              <el-table-column
                prop="solarPowerPhotoelectricInstallCapacity"
                label="千瓦"
                show-overflow-tooltip
                align="center"
                width="250"
              >
                <!-- <template slot-scope="scope">
                      <div>
                        {{
                          scope.row.solarPowerPhotoelectricInstallCapacity
                            | numDealfilters
                        }}
                      </div>
                    </template> -->
              </el-table-column>
            </el-table-column>
            <el-table-column
              label="地热能利用系统装机容量"
              show-overflow-tooltip
              align="center"
            >
              <el-table-column
                prop="geothermalUtilizationInstallCapacity"
                label="千瓦"
                show-overflow-tooltip
                align="center"
                width="220"
              >
                <!-- <template slot-scope="scope">
                      <div>
                        {{
                          scope.row.geothermalUtilizationInstallCapacity
                            | numDealfilters
                        }}
                      </div>
                    </template> -->
              </el-table-column>
            </el-table-column>
          </el-table-column>

          <el-table-column label="太阳能光电系统发电量" align="center">
            <el-table-column
              label="消费量"
              show-overflow-tooltip
              align="center"
            >
              <el-table-column
                prop="solarPhotovoltaicSystemPowerGeneration"
                label="千瓦时"
                show-overflow-tooltip
                align="center"
                width="220"
              >
                <!-- <template slot-scope="scope">
                      <div>
                        {{
                          scope.row.solarPhotovoltaicSystemPowerGeneration
                            | numDealfilters
                        }}
                      </div>
                    </template> -->
              </el-table-column>
            </el-table-column>
          </el-table-column>
        </el-table>
      </el-col>
      <el-col :span="4" v-if="routerType != 3 && isShow">
        <ApprovalRecord :data="logList"></ApprovalRecord>
      </el-col>
    </el-row>
  </div>
</template>
    
    <script>
import auth from "@/plugins/auth";
import {
  comprehensiveAnnualTable,
  getLedgerDetail,
  getFlow,
  getStandbookYearDetail,
} from "@/api/standingbook/newstandingbook.js";
import { deepClone, dealElectricity } from "@/utils/index";
import ApprovalRecord from "@/views/work/budgetDeclaration/components/approvalRecord";
export default {
  props: {},
  components: {
    ApprovalRecord,
  },
  dicts: ["ledger_operate_type"],
  data() {
    return {
      isShow: false,
      // 遮罩层
      loading: true,
      isExpandAll: true,
      dataList: [],
      show: false,
      tabCol: 24,
      logList: [],
      activeMenu: "",
      routerType: null,
      showTitle: false,
      title: {
        year: "",
        organizationName: "",
      },
    };
  },
  created() {},
  mounted() {
    this.loading = false;
    // let type = this.$route.query.type;
    // this.routerType = type;
    // this.activeMenu = this.$route.meta.activeMenu; // 激活的菜单也是返回的菜单
    // // type 1: 树接口 2：详情接口  3: 历年台账数据
    // if (type == 1) {
    //   this.requestgetTree();
    // } else if (type == 2) {
    //   this.getInfo();
    // } else if (type == 3) {
    //   this.showTitle = true;
    //   this.title.year = this.$route.query.year;
    //   this.title.organizationName = this.$route.query.organizationName;
    //   this.requestgetStandbookYearDetail();
    // }
    // setTimeout(() => {
    //   if (type != 3) {
    //     this.requestFlow();
    //   }
    // }, 200);
  },
  filters: {
    numDealfilters(num) {
      let result;
      let num1;
      if (typeof num == "string") {
        num1 = Number(num);
      } else {
        num1 = num;
      }
      result = dealElectricity(num1, 1, 2);
      return result;
    },
  },
  methods: {
    // 上报详情 树结构
    getData(params) {
      this.dataList = [];
      //   let query = this.$route.query;
      //   let params = {};
      //   let year = query.year;
      //   let month = query.month;
      //   let deptId = query.deptId;
      //   params.year = year;
      //   params.month = month;
      //   params.deptId = deptId;
      comprehensiveAnnualTable(params)
        .then((res) => {
          if (res.code === 700) {
            this.$message.warning(res.msg);
            return false;
          }
          let obj = res?.data ?? {};
          if (Object.keys(obj).length > 0) {
            this.dataList.push(obj);
          }
          console.log(this.dataList)
        })
        .catch(() => {
          // this.$message.error("系统错误,请联系管理员!");
        });
    },
    // 历年数据
    requestgetStandbookYearDetail() {
      this.dataList = [];
      let id = this.$route.query.id;
      getStandbookYearDetail(id)
        .then((res) => {
          if (res.code === 700) {
            this.$message.warning(res.msg);
            return false;
          }
          let data = res?.data ?? {};
          if (Object.keys(data).length > 0) {
            this.dataList.push(data);
          }
        })
        .catch(() => {
          // this.$message.error("系统错误,请联系管理员!");
        });
    },
    // 审核详情
    getInfo() {
      this.dataList = [];
      let query = this.$route.query;
      getLedgerDetail(query.id)
        .then((res) => {
          if (res.code === 700) {
            this.$message.warning(res.msg);
            return false;
          }
          let data = res?.data ?? {};
          if (Object.keys(data).length > 0) {
            this.dataList.push(data);
          }
        })
        .catch(() => {
          // this.$message.error("系统错误,请联系管理员!");
        });
    },
    handlerGoback() {
      // this.$router.go(-1);
      let pathRouter = this.activeMenu;
      let query = {};
      // 返回 区域台账审核页面需要显示当前选择的年份月份
      if (pathRouter == "/work/standbook/junioraudit") {
        query.backMonth = this.$route.query.month;
        query.backYear = this.$route.query.year;
      }
      this.$router.push({
        path: pathRouter,
        query: query,
      });
    },
    handlerShow() {
      this.show = !this.show;
      if (this.show) {
        this.tabCol = 18;
        this.requestFlow();
      } else {
        this.tabCol = 24;
      }
    },
    // 请求流程流水
    requestFlow() {
      this.logList = [];
      if (auth.hasPermi("energy:budget-declare:audit-logs")) {
        this.isShow = true;
        let id = this.$route.query.id;
        let params = {};
        params.id = id;
        getFlow(params)
          .then((res) => {
            if (res.code === 700) {
              this.$message.warning(res.msg);
              return false;
            }
            let arr = res?.data ?? [];
            if (arr.length > 0) {
              arr.map((item) => {
                let obj = {
                  eventTime: item?.operateTime ?? "未知时间",
                  signature: item?.operator ?? "未知审核员",
                  eventTypeName: this.findTypename(item?.operatorType),
                  msg: item?.msg ?? "",
                };
                this.logList.push(obj);
              });
            }
          })
          .catch(() => {
            // this.$message.error("系统错误,请联系管理员!");
          });
      } else {
        this.isShow = false;
      }
    },
    findTypename(type) {
      let dictArr = this.dict.type.ledger_operate_type;
      let result;
      if (dictArr.length > 0) {
        dictArr.map((item) => {
          if (item.value == type) {
            result = item.label;
          }
        });
      }
      return result;
    },
  },
};
</script>
    
    <style lang="scss" scoped>
.button-area {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin: 10px 0;
}
.title-area {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin: 10px 0;
  font-size: 28px;
  font-weight: 400;
}
</style>
    